********************************************
	   BANK ACCOUNT PROGRAM
          CS586 Software System Architecture

		Steve Talbot

		   README

********************************************

1) System Requirements

(a) Compiled on system: Mobile Intel Pentium 4 processor 1.8 GHz-M MS Windows XP Operating System


2) Running the program

(a) DOS Command Prompt

	Open a "Command Prompt" window from "Start->Programs->Accessories->Command Prompt".

	Navigate to the  "Project.exe" in the "Debug" folder "cs586_project_talbot.exe", or
	in the "E:\CS586 Steve Talbot\CS586 Executable" directory.

	(type "cd .." to navigate backwards in a directory, type "cd FolderName" to navigate forwards in 
	a directory, and type "ls" to display the contents of the directory)

	Type "Project.exe" and press return to begin running the program (there are no input arguments 
	at start-up).

	The "Root Menu" should be displayed.
	

(b) Eclipse IDE

	1) Select a "Workspace" where the existing project is located.

	This "Workspace" folder ("CS 586 SW SYS ARCH") should have a ".metadata" folder, and a 
	"project" folder.

	Eclipse should show the project, simply titled "project", in the FileChooser in the left hand side 
	view.

	(If this is not the case, try the alternative approach "2)" that follows).

	Right-click the project folder simply named "project", select "Run as" and select 
	"Run Local C/C++ Application"".

	Click on the "Console Tab" at the bottom panel view and expand the window in order to see 
	the "Root Menu" displayed.

	
	OR


	2) Select a "Workspace" where a new project will be created.

	Create a new "C/C++ Managed Make Project" in Eclipse via selecting 
	"File->New->Managed Make C++ Project".

	Type a project name and select all default values by selecting "Next" 2 times, or just select 
	"Finish".

	Right-click the project, and select "Import" (now that the project is created, we need to fill it 
	with the files of source code).

	"Browse" to the directory where the source code files are located, select 
	"General->File System", click "Next", click "Browse".

	Check the checkbox next to each source code file (it has you check each file individually, 
	even if there is a long list of files, unfortunately).

	Press "Finish" and the files should appear in the FileChooser view on the left-hand side under 
	the newly created project folder.

	Right-click the project folder that you just created, select "Run as" and select 
	"Run Local C/C++ Application"".

	Click on the "Console Tab" at the bottom panel view and expand the window in order to see 
	the "Root Menu" displayed.


	NOTE: "main()" method is located in the "MainApplication.cpp" module.


(c) Unix / Linux

	NOTE: This application has not been tested / or compiled on a Unix / Linux machine.


3) System Parameters

	NOTE: these parameters are configurable via the "Change Configuration" menu selection, and 
	          the values shown here are the default values used at program start-up.

	(a) "number of pin attempts for login" = 3 
		(after this the user must re-start the login process)

	(b) "number of pin attempts for activate / deactivate account" = not prescribed or tracked, 
		but user gets 1 attempt per menu selection (the user is not logged out, but returns to 
		main menu and optionally may make unlimited more pin attempts)

	(c) "minimum account balance" = 0

	(d) "penalty" = 25

	(e) "login", "pin" max length = not prescribed or tracked, any allowed 
		(although must be 4 byte integer value, 0 to 2147483647, system prevents otherwise)


4) Menus

	(a) Root Menu

		- Displayed at program start-up.

		- Returned to from "Back" selection in "Manage Configuration" sub-menu, and 
		  after "Logout" operation in the "Main Menu"


	==================================
	         	           MENU SELECTIONS
	==================================
	1) Log In
	2) Open Account
	3) Manage Configuration
	4) End Session


	"1" Log In - the user can log in to their account if it exists.  The application must have access to 
		   the file "Bank_Accounts.bin" in the "C:\Temp" directory in order to log in users from 
		   previous sessions.  This file is created if it doesn't already exist whenever an account 
		   is created.  Otherwise, if the account was stored in memory via a previous "open 
		   account" operation in the current session, the user is logged in using the information 
		   stored in main memory.

	"2" Open Account - the user can create a new account in the application.  The user is prompted 
			to enter their "login", "pin" and "initial account balance".  If the user login is 
			not already registered either in the file "Bank_Accounts.bin" or stored in 
			memory via a previous "open account" operation in the current session, 
			then the account will be created.

	"3" Manage Configuration - the user can select to use all "Configuration #1" or all 
			           "Configuration #2" settings, the user can pick a mix of 
			           "Configuration #1" & "Configuration #2" settings, 

	"4" End Session - the application is stopped.  The user must re-run the program if they wish to 
		           initiate a new session.



	(b) Main Menu

		- Displayed following successful login / pin operations in the "Log In" Root Menu 
		  selection.


	==================================
		           MENU SELECTIONS
	==================================
	1) Balance
	2) Deposit
	3) Withdraw
	4) Activate / Deactivate Account
	5) Current State
	6) Logout


	"1" Balance - the current balance of the user's account is shown.  If the account is currently 
		     overdrawn, this may also include the "overdraw penalty" charged to the account, 
		     in addition to the last "withdraw" operation performed that made the account 
		     "overdrawn" 
		     (i.e.: overdrawn-balance = [ pre-overdrawn-balance ] - [ penalty + withdraw ] )

	"2" Deposit - the user is prompted to enter an amount to deposit to the account balance.  
		     If the account is "Inactive", a message is printed indicating that the deposit 
		     cannot be made.

	"3" Withdraw - the user is prompted to enter an amount to withdraw from the account balance.  
		        If the account is "Inactive", a message is printed indicating that the withdraw 
		        cannot be made.

	"4" Activate - if the user has previously "deactivated" their account, this menu selection prompts 
		      the user to enter their "pin", and a successful pin entry will re-activate the account.  
		      All user transactions (balance, deposit, withdraw) will now be allowed.

	"4" Deactivate - if the user makes this menu selection, the user is prompted to enter their "pin".  
		         A successful pin entry will deactivate the account.  All user transactions 
		         (balance, deposit, withdraw) will now not be allowed until the account is 
		         re-activated via the "Activate" menu selection.

	"5" Current State - this menu selection indicates to the user the current state of the account.  
			When the user is using the "Main Menu", the possible states include "Ready", 
			"Overdrawn", and "Inactive".  "Ready" state indicates that all transactions 
			(balance, deposit, withdraw) are allowed, and the account is not overdrawn.  
			"Overdrawn" state indicates that the "withdraw" transaction is not allowed.  
			However, the user may view their balance and continue to make "deposit" 
			transactions until the account exceeds the "minimum account balance"
			system parameter.
	
	"6" Logout - the user is logged out and the "Root Menu" is displayed.  The user may log in again 
		    with the same account or with any other account that is registered with the 
		    application (registered either in the file "Bank_Accounts.bin" from a previous
		    session or via a previous "open account" operation in the current session).  
		    Whenever the user logs out of their account, the system attempts to write their 
		    account details to the file "Bank_Accounts.bin".  When the user attempts to log in 
		    again, the system attempts to read their account details from this file in order to 
		    complete the log in operation.


	(c) Configuration Menu

		- Reached via a "Root Menu" selection.  Presents a sub-menu of selections
		  for picking "Configuration" settings.


	==================================
		  CONFIGURATION SELECTIONS
	==================================

	WARNING: if configuration is changed from 1 to 2,
		  and the user logs into an account
		  with 0 < balance < 100, if the user
		  performs "deposit" or "withdraw"
		  such that the balance remains in this range,
		  the system will change the account to the
		  "overdrawn" state and apply a penalty.

		1) Set Configuration to ALL \"Configuration #1\"
		2) Set Configuration to ALL \"Configuration #2\"
		3) Pick a MIX of Configuration #1 & #2 settings
		4) View Current Configuration
		5) View Configuration Options
		b) Back (previous menu)


	"1" Set Configuration to ALL \"Configuration #1\"

		"1" is the default configuration that the system begins with at startup.
		Fewer user messages displayed. The user may toggle back and forth between 
		this configuration and configuration #2.
	       	(maxAttempts = 3, minBalance = 0, penalty = 25)


	"2" Set Configuration to ALL \"Configuration #2\"

		"2" is the alternate configuration that can be switched to from this menu.
		More verbose messages displayed.  The user may toggle back and forth between 
		this configuration and configuration #1.
	      	(maxAttempts = 5, minBalance = 100, penalty = 5)


	"3" Pick a MIX of Configuration #1 & #2 settings

		the user is prompted to enter either "1" or "2", in order to select the different 
		"configurations" available.  Each configuration has a slightly different set of user 
		prompts.


		==============================
        		       CONFIGURATION SELECTIONS (MIX)
		==============================

		1)        max # pin attempts: configuration #1
		2)       min account balance: configuration #1
		3)           overdraw penalty: configuration #2
		4)                             login: configuration #2
		5)                               pin: configuration #1
		6)                 open account: configuration #1
		7)                         balance: configuration #2
		8)                          deposit: configuration #2
		9)                        withdraw: configuration #1
		10)                   pin prompt: configuration #1
		11)           incorrect id msg: configuration #2
		12)          incorrect pin msg: configuration #2
		13) too many attempts msg: configuration #1
		14)               display menu: configuration #1
		15)            deactivate msg: configuration #2
		16)            make withdraw: configuration #2
		17)                penalty msg: configuration #1
		18)              make deposit: configuration #1
		19)           display balance: configuration #2
		20)       below min balance: configuration #2
		21)               activate msg: configuration #1
		22)   inactive account msg: configuration #1
		b) Back (previous menu)

		Enter selection to configure: 15
		1 or 2: 1


	"4" View Current Configuration

		displays the "Configuration" options in detail, feature-by-feature,
		and at the end stating 1 of 3 configuration settings:

		"CURRENT CONFIGURATION: #1"

		"CURRENT CONFIGURATION: #2"

		"CURRENT CONFIGURATION: #3" (mix)


	"5" View Configuration Options

		displays the "configuration" options available for both 
		"Configuration #1" and "Configuration #2" in detail, feature-by-feature:


	1) Configuration #1 (default)
	      max # pin attempts: 3
	     min account balance: 0
	         overdraw penalty: 25 (lower min = bigger penalty)
		             login: load local account copy, else load file copy
			  pin: no extra output
         		 open account: default prompt
		         balance: no extra output
		          deposit: no extra output
		       withdraw: no extra output
		     pin prompt: default prompt
	           incorrect id msg: default message
	too many attempts msg: default message
		 display menu: either \"Activate\" or \"Deactivate\" shown, not both
	            deactivate msg: default message
	            make withdraw: no extra output
		  penalty msg: no extra output
		make deposit: no extra output
	           display balance: default balance message
	       below min balance: default message
	               activate msg: default message
	   inactive account msg: default message

	2) Configuration #2
	     max # pin attempts: 5
	    min account balance: 100
	        overdraw penalty: 5 (bigger min = lower penalty)
		             login: load file account copy (never local copy)
			 pin: output # pin \"attempts\" made
		        balance: output \"invoked\" message
		         deposit: output \"min balance\", \"deposit\", \"new balance\"
		       withdraw: output \"min balance\", \"withdraw\", \"new balance\"
		    pin prompt: output alternate prompt
	           incorrect id msg: output alternate message
	too many attempts msg: output alternate message
		 display menu: Both \"Activate / Deactivate\" shown
	            deactivate msg: output alternate message
	            make withdraw: output \"overdrawn\" message when account is overdrawn
	                penalty msg: output \"penalty\" message when account is overdrawn
	              make deposit: output \"overdrawn\" message when account is overdrawn
	           display balance: output alternate balance message
	      below min balance: output alternate message
	              activate msg: output alternate message
	   inactive account msg: output alternate message


5) "Open Account" and "Logout" save the user account to file (to the C:\Temp directory).

	(a) If the user performs an End Session operation, the users information is not lost.   
	     When the user re-starts the program and attempts to login, the application reads the
	     users information from file.  For this feature to work, there MUST be a C:\Temp folder
	     which is not checked "read-only".
	     (this is an add-on feature, strictly apart of the implemenation, and is not shown in the 
	      design document).

	(b) If the user performs a Open Account operation, the users new account details
	     (id, password, balance, is activated, is overdrawn) are written to file. 

	(c) If the user performs a Logout operation, the users latest account details
	     (id, password, balance, is activated, is overdrawn) are written to file.  

	(d) If the C:\Temp folder does not exist, the "login" and "logout" operations are affected.

		- "login": the program will store account information in main memory only (not to file).
			Therefore, "login" will only be performed using accounts which have been
			created in the current user session, stored in main memory.

		- "logout": the program will not have access to the file "Bank_Accounts.bin",
			  so account information will not be stored persistently to file during logout.
			  Therefore, account information will not be retrieved in subsequent user 
			  sessions.

	(e) If the C:\Temp folder of the file "Bank_Accounts.bin" is moved, erased or renamed
	      while the program is running, the "login" and "logout" operations are affected.

		- "login": the user id will not be recognized, because the file "Bank_Accounts.bin"
			cannot be reached.  Therefore, the user will not be able to log in.

		- "logout": the user will be logged out, but because the file "Bank_Accounts.bin"
			cannot be reached, the user account will not be stored persistently to file.
			Therefore, any modifications to the user account data since the last "logout"
			operation will be lost.

	(f) Both"(d)" and "(e)" should be avoided if possible in order to maximize the functionality of 
	    the program.
